#ifndef rs_config_h
#define rs_config_h

#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/route.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sgtty.h>
#include <fcntl.h>
#include <unistd.h>
#include "scps.h"
#include "gw.h"

struct side_conf {
  char name[MAX_NAME_LEN];
  uint32_t addr[MAX_ADDRS];    
  int addr_cnt;    
  uint32_t mask[MAX_ADDRS];    
  char tap_name[MAX_NAME_LEN];    
  int32_t buf;    
  int32_t rbuf;    
  int32_t rate;    
  int32_t min_rate;    
  int32_t cc;    
  int32_t divport;    
  int mtu;    
  int smtu;    
  int ts;    
  int snack;    
  int nodelay;    
  int snack_delay;    
  int ack_behave;    
  int ack_delay;    
  int tcponly;    
  int next_hop;    
  int32_t irto;    
  int vegas_alpha;    
  int vegas_beta;    
  int vegas_gamma;    
  int vegas_ss;    
  int flow_control_cap;    
  int tap_no_phy;    
  int32_t scps_security;    
  int32_t layering;    
  int32_t overhead;    
  int32_t mss_ff;    
  int nl;     
  int gateway_lan_or_wan;    
  uint32_t minrto;    
  uint32_t maxrto;    
  uint32_t maxrto_ctr;    
  uint32_t maxpersist_ctr;    
  uint32_t rtopersist_max;    
  uint32_t rto_to_persist_ctr;    
  uint32_t embargo_fast_rxmit_ctr;    
  int msltimeout;    
  int tp_compress;    
  int div_addr;    
  int div_port;    
  int encrypt_ipsec_downstream;    
  uint32_t encrypt_pre_overhead;    
  uint32_t encrypt_block_size;    
  uint32_t encrypt_post_overhead;    
  uint32_t ecbs1;    
  char ecbs1_value [MAX_ECBS_VALUE];    
  uint32_t ecbs1_len;    
  uint32_t ecbs2;    
  char ecbs2_value [MAX_ECBS_VALUE];    
  uint32_t ecbs2_len;
};


typedef struct  {
  struct side_conf a;
  struct side_conf b;

  int32_t c_divport;
  int  c_netstat_interval;
  int  c_scps_local_udp_port;
  int  c_scps_remote_udp_port;
  int  c_divert_start_rule;
  int  c_divert_insert_rule;
  int32_t c_clust_thresh;
  int  c_other_proto_qlen;
  int  c_other_proto_xrate_drop;
  int  c_other_proto_non_ip;
  int  c_tap_remote_access;
  /* put other stuff as needed here..... */
} GW_ifs;

GW_ifs *get_ifs(void);
struct side_conf *rs_aside(void);
struct side_conf *rs_bside(void);


#endif 
